package com.example.demo.service;



import com.example.demo.mapper.CommentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentService {
    @Autowired
    private CommentMapper commentMapper;

    public int createComment(int uid, int pid, String traceNo, int totalPrice) {
        return commentMapper.createComment(uid,pid,traceNo,totalPrice);
    }

    public int addComment(int uid, int pid, String traceNo,String content, int rating) {
        return commentMapper.addComment(uid,pid,traceNo,content,rating);
    }

    public List<Object> getCommentByPid(int pid) {
        return commentMapper.getCommentByPid(pid);
    }

    public List<Object>  getCommentByRating(int minRating, int maxRating, int pid) {
        return commentMapper.getCommentByRating(minRating,maxRating,pid);
    }

//    public Object getCommentByPid(int pid, int rating) {
//        return commentMapper.getCommentByPid(pid,rating);
//    }
}
